package com.yuwei.module_sign.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yuwei.module_sign.R

class MinutesAdapter:BaseQuickAdapter<String,BaseViewHolder>(R.layout.attendances_item) {
    private var index = 0
    fun setIndex(int: Int){
        index = int
    }
    override fun convert(holder: BaseViewHolder, item: String) {

        if (index == holder.position){
            holder.setText(R.id.jl_type, item)
                .setTextColor(R.id.jl_type,Color.WHITE)
                .setBackgroundResource(R.id.jl_type, R.drawable.dl_ba2)
        }else{
            holder.setText(R.id.jl_type, item)
                .setTextColor(R.id.jl_type,Color.BLACK)
                .setBackgroundResource(R.id.jl_type, R.drawable.dl_ba1)
        }


    }
}